var mongoose = require("mongoose");
var Schema = mongoose.Schema;

const MoneySchema = new Schema(
  {
    user_id: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "users",
    },
    name: {
      type: String,
      default: "",
    },
    money: {
      type: Number,
      default: 0,
    },
    date: {
      type: Date,
      default: Date.now(),
    },
  },
  {
    versionKey: false,
  }
);
module.exports = User = mongoose.model("moneys", MoneySchema);
